<?php
# 生成签名
Route::get("text",function(){
    $username = "15816039466";
    $password = "1234";
    $token = "adsa";
    $timestemp = time();
    # 可以使用时间戳
    # $time = time();
    $sign = md5($username . $password . $token . $timestemp);
    return $timestemp.",".$sign;
});
# 定义接口路由
Route::group(["middleware" => ["checkapi"],"namespace" => 'Api'],function (){
    Route::post("login","ApiuserController@login");
    # 用户授权
    Route::post("auth","ApiuserController@auth");
    # 租客资料
    Route::post("renting","RentingController@update");
    # 图片上传路由
    Route::post("upfile","RentingController@upfile");
    # 看房通知
    Route::get("renting/notice","RentingController@notice");
    # 推荐房源
    Route::get("fang/recommend","FangController@recommend");
    # 房源属性
    Route::get("fang/attr","FangController@attr");
    # 资讯获取
    Route::get("article","ArticleController@index");
    # 房源列表
    Route::get("fangs","FangController@index");
    # 资讯访问
    Route::post("article/count","ArticleController@count");
    # 资讯详情
    Route::get("article/{article}","ArticleController@show");
    # 租客个人资料
    Route::get("renting/{renting}","RentingController@show");
});
